package idv.takeshi.software.productline.bookstore.domain.model.useraccount;

import javax.persistence.Entity;

import org.apache.commons.lang.builder.EqualsBuilder;

/**
 * A model class which represents as a Clerk, kind of user account role.
 * @author takeshi
 *
 */
@Entity
public class Clerk extends Role {
	
	private static final String ROLE_NAME = "ROLE_CLERK";
	
	/* (non-Javadoc)
	 * @see idv.takeshi.software.productline.bookstore.model.useraccount.Role#getRoleName()
	 */
	@Override
	public String getRoleName() {
		return ROLE_NAME;
	}
	
	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (obj == null) { return false; }
		   if (obj == this) { return true; }
		   if (!(obj instanceof Clerk)) {
		     return false;
		   }
		   Clerk rhs = (Clerk) obj;
		   return new EqualsBuilder()
			   .appendSuper(super.equals(rhs))
		       .isEquals();
	}
	
}
 
